Copyright(C) 1994 Terumasa KODAKA , Takeshi KONO

■RS-232C BIOS


INT 19h - Function 00h (BIOS)
Classification   RS-232C BIOS
Name             Initialize RS-232C BIOS (single mode)
Target           Normal, Hi-Res, PC-98LT/HA
Input            AH=00h: Specify channel 0 (built-in RS-232C)
                   10h: Specify channel 1 (extended RS-232C interface) ■ [Hi-Res]
                   20h: Specify channel 2 (extended RS-232C interface) ■ [Hi-Res]
                 AL=Transfer speed ■ [Only channel 0 is valid]
                   00h = 75bps
                   01h = 150bps
                   02h = 300bps
                   03h = 600bps
                   04h = 1200bps
                   05h = 2400bps
                   06h = 4800bps
                   07h = 9600bps
                   08h = 19200bps■[Only for devices that support 19200bps]
                     * If an unsupported value is specified, it will be set to 1200bps
                 BH=Timeout time when sending (unit: 500ms)
                   * Range is 01-FFh. If 00h is specified, the default value (02h) will be used
                 BL=Timeout time when receiving (unit: 500ms)
                   * Range is 01-FFh. Specifying 00h will set it to the default value
                     (1Eh for normal mode, 3Ch for high-resolution mode)
                 CH=8251A mode word (asynchronous mode)
                   bit 7,6: stop bit length
                     11b = 2 bits
                     10b = 1.5 bits
                     01b = 1 bit
                   bit 5: Parity specification
                     1 = Even parity
                     0 = Odd parity
                   bit 4: Parity presence/absence
                     1 = Yes
                     0 = No
                   bit 3,2: character length
                     11b = 8 bits
                     10b = 7 bits
                     01b = 6 bits
                     00b = 5 bits
                   bit 1,0: clock rate
                     11b = 64 times
                     10b = 16 times
                 CL=8251A command word
                   bit 6: internal reset
                     1 = yes
                     0 = no
                   bit 5: RTS terminal
                     1 = ON
                     0 = OFF
                   bit 4: error flag reset
                     1 = Yes
                     0 = No
                   bit 3: Send break signal
                     1 = Yes
                     0 = No
                   bit 2: Receive enabled
                     1 = Enabled
                     0 = Disabled
                   bit 1: DTR terminal
                     1 = ON
                     0 = OFF
                   bit 0: Send enabled
                     1 = Enabled
                     0 = Disabled
                 ES:DI=Start address of buffer control block
                 DX=Receive buffer size (unit: byte)
Output           AH=Return code
                   00h=Normal end
                   04h=When channel 1 or 2 is specified, the extended RS-232C interface board is not connected■[Hi-Res]
                 AL=Undefined
Explanation    o Initialize the RS-232C BIOS in asynchronous mode. XON/XOFF flow control is not performed during reception and transmission.
               o Synchronous communication is not supported by the RS-232C BIOS.
               o The receive buffer is allocated immediately after the buffer control block specified by ES:DI.
                 The top address of the receive buffer is ES:DI+14h in normal mode and PC-98LT/HA, and ES:DI+18h in high-resolution mode.
                 The end of the receive buffer is ES:DI+14h+DX-1 for all models. In high-resolution mode, the size of the buffer control
                 block is 4 bytes larger than in normal mode, but the actual receive buffer size is reduced by 4 bytes from the value
                 specified by DX to ensure compatibility.
               o The number of receive characters that can be stored in the receive buffer is half the actual receive buffer size.
                 In single mode, the receive buffer stores the received character (1 byte) and the 8251A status (1 byte) at the time the character was received.
               u In normal mode, the MS-DOS AUX driver traps this function. Note that the function's functionality and register interface are incompatible with the BIOS. See INT 19h - Function 00h (RSDRV).
               o In high-resolution mode, the transfer speeds for channels 1 and 2 are set with the DIP switches on the extended RS-232C interface board.
               o In normal mode, a different interrupt is assigned to each channel.
                 Channel 0 = INT 19h, channel 1 = INT D4h, channel 2 = INT D5h. The register interface for INT D4h and D5h is the same as for INT 19h.
               u To determine whether the device supports 19200bps, refer to F8E8:0002h (normal) or FFE8:0002h (high-resolution).
                 If the device supports 19200bps, 19200bps can be used in the BIOS even in high-resolution mode on the 98 High Resolution Board (PC-9821A-E02).
               o For details on the buffer control block, etc., refer to the Technical Data Book.
Related          INT 19h - Function 01h
                 INT 19h - Function 07h [Hi-Res]
                 0000:0556h
                 0000:055Bh
                 0000:05C1h
                 0000:05F0h
                 0000:05F4h
                 F8E8:0002h bit 2 [Normal]
                 FFE8:0002h bit 2 [Hi-Res]
                 I/O 0030h
                 I/O 0035h
                 I/O 0075h
                 I/O 00B0h


INT 19h - Function 01h (BIOS)
Classification   RS-232C BIOS
Name             Initialization with flow control (single mode)
Target           Normal, High Resolution, PC-98LT/HA
Input            AH=01h: Channel 0 (built-in RS-232C)
                   11h: Channel 1 (Extended RS-232C interface) ■ [High Resolution]
                   21h: Channel 2 (Extended RS-232C interface) ■ [High Resolution]
                 AL=Transfer speed ■ [Only channel 0 is valid]
                   * Same as INT 19h - Function 00h (BIOS)
                 BH=Timeout time when sending (unit: 500 ms)
                   * Same as INT 19h - Function 00h (BIOS)
                 BL=Timeout time when receiving (unit: 500 ms)
                   * Same as INT 19h - Function 00h (BIOS)
                 CH=8251A mode word (asynchronous mode)
                   * INT 19h - Same as Function 00h (BIOS)
                 CL=Command word for 8251A
                   * Same as INT 19h - Function 00h (BIOS)
                 ES:DI=Start address of buffer control block
                 DX=Receive buffer size (unit: byte)
Output           AH=Return code
                   00h=Normal end
                   04h=When channel 1 or 2 is specified, the extended RS-232C interface board is not connected■[Hi-Res]
                 AL=Undefined
Explanation    o Initializes the RS-232C BIOS in asynchronous mode. Performs XON/XOFF flow control when receiving.
                 Does not perform XON/XOFF flow control when sending. The RS-232C BIOS in normal mode does not support XON/XOFF flow control when sending.
                 Otherwise, it is the same as INT 19h - Function 00h (BIOS).
               u In normal mode, the MS-DOS AUX driver traps this function. In this case, please note that the function and register interface are not
                 compatible with the BIOS. See INT 19h - Function 01h (RSDRV).
               o In normal mode, a different interrupt is assigned to each channel.
                 Channel 0 = INT 19h, Channel 1 = INT D4h, Channel 2 = INT D5h. The register interface for INT D4h and D5h is the same as INT 19h.
Related          INT 19h - Function 00h
                 INT 19h - Function 07h [Hi-Res]
                 I/O 0030h
                 I/O 0035h
                 I/O 0075h
                 I/O 00B0h


INT 19h - Function 02h (BIOS)
Classification   RS-232C BIOS
Name             Get received data length
Target           Normal, High Resolution, PC-98LT/HA
Input            AH=02h: Channel 0 (built-in RS-232C)
                   12h: Channel 1 (Extended RS-232C interface) ■ [High Resolution]
                   22h: Channel 2 (Extended RS-232C interface) ■ [High Resolution]
Output           AH=Return code
                   00h=Normal termination
                   01h=RS-232C BIOS not initialized
                   02h=Receive buffer overflow
                 CX=Number of received characters in receive buffer
Explanation    o Check the number of received characters stored in the receive buffer.
                 In single mode, and when the receive buffer is managed in word units in extended mode, the received characters and
                 status are stored in the receive buffer as a set of 2 bytes, but even in this case, the value
                 returned by this function is the number of received characters.
               u Once a receive buffer overflow (AH=02h) notification is received by the return code, the flag indicating the overflow is cleared in the BIOS.
               o When the receive buffer overflows in extended mode, the 8251A must be initialized.
               u In normal mode, the MS-DOS AUX driver traps this function. Note that the function's functionality and register
                 interface are incompatible with the BIOS. See INT 19h - Function 02h (RSDRV).
               o In normal mode, a different interrupt is assigned to each channel.
                 Channel 0 = INT 19h, channel 1 = INT D4h, channel 2 = INT D5h. The register interface for INT D4h and D5h is the same as for INT 19h.
Related


INT 19h - Function 03h (BIOS)
Classification   RS-232C BIOS
Name             Data transmission
Target           Normal, Hi-Res, PC-98LT/HA
Input            AH=03h: Channel 0 (built-in RS-232C)
                   13h: Channel 1 (Extended RS-232C interface) ■ [Hi-Res]
                   23h: Channel 2 (Extended RS-232C interface) ■ [Hi-Res]
                 AL=Transmit data
                 CL=Reference status bit ■ [Extended mode]
                   bit 7=DSR terminal
                   bit 6=CTS terminal
                   bit 5-3=000b
                   bit 2=TxEMPTY flag
                   bit 1,0=00b
Output           AH=Return code
                   00h=Normal termination
                   01h=RS-232C BIOS not initialized
                   02h=Receive buffer overflow
                   03h=Timeout
                   05h=When XON/XOFF is enabled during transmission, transmission is stopped by receiving XOFF ■ [Hi-Res]
                 AH = Undefined
Explanation    o Transmits 1 byte of data.
                 No buffering of transmitted data is performed.
               u Once a notification of receive buffer overflow (AH=02h) is received in the return code, the flag indicating overflow in the BIOS is cleared.
               o When the receive buffer overflows in extended mode, the 8251A must be initialized.
               u In normal mode, the MS-DOS AUX driver traps this function. Note that the function and register
                 interface are incompatible with the BIOS. See INT 19h - Function 03h (RSDRV).
               o In normal mode, a different interrupt is assigned to each channel.
                 Channel 0 = INT 19h, Channel 1 = INT D4h, Channel 2 = INT D5h. The register interface for INT D4h and D5h is the same as INT 19h.
               o For details on the buffer control block, etc., see the Technical Data Book.
Related


INT 19h - Function 04h (BIOS)
Classification   RS-232C BIOS
Name             Receiving data
Target           Normal, Hi-Res, PC-98LT/HA
Input            AH=04h: Specify channel 0 (built-in RS-232C)
                   14h: Specify channel 1 (Extended RS-232C interface) ■ [Hi-Res]
                   24h: Specify channel 2 (Extended RS-232C interface) ■ [Hi-Res]
Output           AH=Return code
                   00h=Normal termination
                   01h=RS-232C BIOS not initialized
                   02h=Receive buffer overflow
                   03h=Timeout
                 CH=Received data
                 CL=Status when receiving data
                   bit 7:DSR
                     1=ON
                     0=OFF
                   bit 6:BREAK
                     1=Detected
                     0=Not detected
                   bit 5:Framing error
                     1=Detected
                     0=Not detected
                   bit 4:Overrun error
                     1=Detected
                     0=Not detected
                   bit 3: Parity error
                     1=Detected
                     0=Not detected
                   bit 2:■[Normal]TxEMPTY
                     1=Transmit buffer empty
                     0=Transmit buffer full
                   bit 2:■[Hi-Res]System port status CI#
                     1=OFF
                     0=ON
                   bit 1:System port status CTS#
                     1=OFF
                     0=ON
                   bit 0:System port status CD#
                     1=OFF
                     0=ON
Explanation    o Extracts one byte of received data from the receive buffer and outputs the received data and status.
                 If there is no received data in the receive buffer, waits for the receive timeout period set at initialization.
               o When the receive buffer is managed in byte units in extended mode, returns the current status to CL.
               u Once a receive buffer overflow (AH=02h) notification is received in the return code, the flag indicating overflow in the BIOS is cleared.
               o In extended mode, if the receive buffer overflows, the 8251A must be initialized.
               u In normal mode, the MS-DOS AUX driver traps this function. Note that in this case, the function's functionality and
                 register interface are incompatible with the BIOS. See INT 19h - Function 04h (RSDRV).
               o In normal mode, a different interrupt is assigned to each channel.
                 Channel 0 = INT 19h, channel 1 = INT D4h, channel 2 = INT D5h. The register interface for INT D4h and D5h is the same as for INT 19h.
               o For details on the buffer control block, etc., see the Technical Data Book.
Related


INT 19h - Function 05h (BIOS)
Classification   RS-232C BIOS
Name             Command output to 8251A
Target           Normal, Hi-Res, PC-98LT/HA
Input            AH=05h: Specify channel 0 (built-in RS-232C)
                   15h: Specify channel 1 (expanded RS-232C interface) ■ [Hi-Res]
                   25h: Specify channel 2 (expanded RS-232C interface) ■ [Hi-Res]
                 AL=Command to output to 8251A
                   * Same as INT 19h - Function 00h (BIOS)
Output           AH=Return code
                   00h=Normal termination
                   01h=RS-232C BIOS not initialized
                   02h=Receive buffer overflow
Explanation    o Write a command word to 8251A.
               u The technical data book states that the "command to be output to the 8251A" should be specified in CL, but in reality it is specified in AL.
               u Once a notification of receive buffer overflow (AH=02h) is received in the return code, the flag indicating overflow is cleared in the BIOS.
               o When the receive buffer overflows in extended mode, the 8251A must be initialized.
               u In normal mode, the MS-DOS AUX driver traps this function. Note that the function's functionality and
                 register interface are incompatible with the BIOS. See INT 19h - Function 05h (RSDRV).
               u The PC-98HA technical data book states that the return code is returned in AL, but in reality it is returned in AH.
               o In normal mode, a different interrupt is assigned to each channel.
                 Channel 0=INT 19h, channel 1=INT D4h, channel 2=INT D5h. The register interface for INT D4h and D5h is the same as that for INT 19h.
                 For details on the buffer control block, etc., see the Technical Data Book.
Related


INT 19h - Function 06h (BIOS)
Classification   RS-232C BIOS
Name             Get status
Target           Normal, Hi-Res, PC-98LT/HA
Input            AH=06h: Specify channel 0 (built-in RS-232C)
                   16h: Specify channel 1 (Extended RS-232C interface) ■ [Hi-Res]
                   26h: Specify channel 2 (Extended RS-232C interface) ■ [Hi-Res]
Output           AH=Return code
                   00h=Normal termination
                   01h=RS-232C not initialized
                   02h=Receive buffer overflow
                 CH=8251A status
                   bit 7:DSR
                     1=ON
                     0=OFF
                   bit 6:BREAK
                     1=Detected
                     0=Not detected
                   bit 5:Framing error
                     1=Detected
                     0=Not detected
                   bit 4:Overrun error
                     1=Detected
                     0=Not detected
                   bit 3: Parity error
                     1=Detected
                     0=Not detected
                   bit 2:TxEMPTY
                     1=Transmit buffer empty
                     0=Transmit buffer full
                   bit 1:RxREADY
                     1=Received character
                     0=No received character
                   bit 0:TxREADY
                     1=Transmit ready
                     0=Transmit busy
                 CL=Modem status
                   bit 7:CI#
                     1=OFF
                     0=ON
                     * The original PC-9801 does not support CI#. Always 0.
                   bit 6:CTS#
                     1=OFF
                     0=ON
                   bit 5:CD#
                     1=OFF
                     0=ON
                   bit 4-0:Reserved
Explanation    o Gets the current status of RS-232C.
               u Once a notification of receive buffer overflow (AH=02h) is received in the return code, the flag indicating overflow in the BIOS is cleared.
               o In extended mode, if the receive buffer overflows, the 8251A must be initialized.
               u In normal mode, the MS-DOS AUX driver traps this function. Note that the functionality and register interface of the
                 function are incompatible with the BIOS. See INT 19h - Function 06h (RSDRV).
               o In normal mode, a different interrupt is assigned to each channel.
                 Channel 0=INT 19h, channel 1=INT D4h, channel 2=INT D5h. The register interface for INT D4h and INT D5h is the same as that for INT 19h.
               o For details on the buffer control block, etc., see the Technical Data Book.
Related          I/O 0033h


INT 19h - Function 07h (BIOS)
Classification   RS-232C BIOS
Name             Initialize RS-232C BIOS (Extended Mode)
Target           Hi-Res
Input            AH=07h: Specify channel 0 (built-in RS-232C)
                    17h: Specify channel 1 (Extended RS-232C interface)
                    27h: Specify channel 2 (Extended RS-232C interface)
                 AL=Transfer speed■[Only channel 0 is valid]
                   * Same as INT 19h - Function 00h (BIOS)
                 BX=BIOS control information
                   bit 15:Reserved
                   bit 14:SI/SO control
                     1=Perform
                     0=Do not perform
                   bit 13:Sender X flow control
                     1=Yes
                     0=No
                   bit 12:Receiver X flow control
                     1=Yes
                     0=No
                   bit 11:ER (DTR) signal control when receive buffer full
                     1=Yes (ER OFF)
                     0=No
                   bit 10: RS (RTS) signal control when receive buffer is full
                     1=Yes (RS OFF)
                     0=No
                   bit 9,8: Processing of received DEL (7Fh/FFh)
                     11b=Ignore
                     10b=Convert to BS (08h)
                     01b=Convert to NULL (00h)
                     00b=No conversion
                   bit 7-1: Reserved
                   bit 0: Receive buffer management
                     1=Word unit
                     0=Byte unit
                 CH=8251A mode word (asynchronous mode)
                   * Same as INT 19h - Function 00h (BIOS)
                 CL=8251A command word
                   * Same as INT 19h - Function 00h (BIOS)
                 DX=Receive buffer size
                 ES:DI=First address of buffer control block
Output           AH=Return code
                   00h=Normal end
                   04h=Channel 1, 2 specified, no expansion RS-232C interface board is connected
Explanation    o Initialize the RS-232C BIOS in asynchronous mode.
                 You can also select XON/XOFF flow control during reception and transmission.
                 When initialized with this function, INT 1Fh - Function 83h is executed at the end of each reception interrupt (after EOI is issued).
               o The receive buffer is allocated immediately after the buffer control block specified by ES:DI.
                 The start address of the receive buffer is ES:DI+18h, and the end address is ES:DI+18h+DX-1.
               o When the receive buffer is managed in word units (BX bit 0=1), the number of receive characters that can be stored in the
                 receive buffer is half the actual receive buffer size. This is because the receive buffer stores the received character (1 byte) and
                 the 8251A status (1 byte) at the time the character was received.
                 When the receive buffer is managed in bytes (BX bit 0=0), the number of received characters can be stored equal to the actual receive buffer size.
               o Other than that, it is the same as INT 19h - Function 00h (BIOS).
               o For details on the buffer control block, etc., see the Technical Data Book.
Related          INT 19h - Function 00h (BIOS)
                 INT 1Fh - Function 83h [Hi-Res]
                 I/O 0030h
                 I/O 0035h
                 I/O 0075h
                 I/O 00B0h